<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<script type="text/javascript">
			var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;    //11位手机号码正则
			function checkSubmit() {
			var a=document.getElementById('tel').value
				if (a =="") {
					txt.innerHTML = "请填写您的手机号码！";
					
				} else if (!reg_tel.test(a)) {
					txt.innerHTML="请正确填写您的手机号码！";
					
					return false;
				}else{
					txt.innerHTML='手机号正确'
					
				}
			}
			
		</script>


	<body>
		<form >
			<div>
			手机号<input type="text" name="tel" id="tel" value=""/><span id="txt"></span><br>
			<input type="submit" name="" id="" value="提交"   onfocus="checkSubmit()"/>
			</div>
		</form>
	</body>
</html>
